import Vue from 'vue'
import Router from 'vue-router'

//后台 路由
import adminRouter from './admin'
import mobileRouter from './mobile'

Vue.use(Router);

export default new Router({
  //mode: 'history',
  scrollBehavior(to, from, savedPosition) {
    if (to.hash) {
      return {
        selector: to.hash
      }
    } else if (savedPosition) {
      return savedPosition
    } else {
      return {x: 0, y: 0}
    }
  },
  routes: mobileRouter.concat(adminRouter)
})
